package net.plankton.agents;

import net.plankton.context.Context;
import net.plankton.context.RiskContext;
import net.plankton.context.occurrence.Occurrence;
import net.plankton.events.GenericOccurrence;
import net.plankton.selectors.GenericSelector;

public abstract class Agent extends GenericOccurrence{

	
	
	
	public Agent(double percent, String description, Context context) {
		super(percent, description, context);
		
	}

	public Agent(GenericSelector genericSelector, String description,
			Context context) {
		super(genericSelector,description,context);
	}

	protected double threatLevel=0;
	
	public void setThreatLevel(double threatLevel) {
		this.threatLevel=threatLevel;
	}

	@Override
	public void happen() {
		
		super.happen();
		changeThreadLevel();
	}
	
	public void changeThreadLevel() {
		if (threatLevel>0) {
			context.getRiskContext().changeThreatLevel(threatLevel);
		}
	}
	
	
}
